home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-01-05 | 2.1 KB | 117 lines | [TEXT/PJMM] |
- UNIT GLOBALS;
-
- INTERFACE
-
- CONST
- { --------------------------------------------- }
- { menu id constants }
- { --------------------------------------------- }
- APPLEID = 128;
- FILEID = 129;
- EDITID = 130;
- COMPAREID = 131;
- LOOPID = 132;
- POINTERID = 133;
-
- { --------------------------------------------- }
- { menu item constants }
- { --------------------------------------------- }
- ABOUTITEM = 1;
-
- NEWITEM = 1;
- OPENITEM = 2;
- CLOSEITEM = 3;
- SAVEITEM = 5;
- SAVEASITEM = 6;
- PAGESETUPITEM = 8;
- PRINTITEM = 9;
- QUITITEM = 11;
-
- UNDOITEM = 1;
- CUTITEM = 3;
- COPYITEM = 4;
- PASTEITEM = 5;
- CLEARITEM = 6;
- CLIPITEM = 8;
-
- { --------------------------------------------- }
- { test to see if EventRecord.modifiers }
- { contains change to/from system window }
- { on window activate/deactivate events }
- { --------------------------------------------- }
- CHANGEFLAG = 2;
-
- TO_C_FUNCTION = 1;
- TO_CR_FUNCTION = 2;
- TO_P_FUNCTION = 3;
- TYPE
- context = (system, application);
-
- VAR
- appleMenu: MenuHandle;
- fileMenu: MenuHandle;
- editMenu: MenuHandle;
- compareMenu: MenuHandle;
- pointerMenu: MenuHandle;
- loopMenu: MenuHandle;
-
- theWindow: WindowPtr;
-
- theEvent: EventRecord;
-
- userQuit: Boolean;
-
- cTime: Longint;
- crTime: Longint;
- pTime: Longint;
-
- cPerf: Extended;
- crPerf: Extended;
- pPerf: Extended;
-
- cTimeDst: Rect;
- crTimeDst: Rect;
- pTimeDst: Rect;
- ptrSizeDst: Rect;
- loopSizeDst: Rect;
-
- cPerfDst: Rect;
- crPerfDst: Rect;
- pPerfDst: Rect;
-
- perfIndex: Integer;
-
- pSize: Longint;
-
- numLoops: Integer;
-
- do_it: ControlHandle;
-
-
- PROCEDURE CenterWindow (wind: WindowPtr; r: Rect);
-
- IMPLEMENTATION
-
- PROCEDURE CenterWindow; { wind: WindowPtr; r: Rect}
-
- VAR
- r2: Rect;
- windW: INTEGER;
- windH: INTEGER;
- rectW: INTEGER;
- rectH: INTEGER;
-
- BEGIN
- r2 := wind^.portRect;
-
- windW := r2.right - r2.left;
- windH := r2.bottom - r2.top;
-
- rectW := r.right - r.left;
- rectH := r.bottom - r.top;
-
- MoveWindow(wind, r.left + (rectW - windW) DIV 2, r.top + (rectH - windH) DIV 2, FALSE);
- END;
-
-
- END.